package com.lzy.cloud.ticket.train.remote;

import com.lzy.cloud.ticket.train.remote.request.OrderInfoRequest;
import com.lzy.framework.core.output.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 访问order服务
 *
 * @author lc
 * @version 2018/7/23
 */
@FeignClient(name = "lzy-cloud-order")
public interface OrderApi {

    /**
     * 取消订单
     * @param token
     * @param orderId
     * @return
     */
    @PostMapping("/order/cancel")
    Result cancel(@RequestHeader("token") String token, @PathVariable("orderId") String orderId);

    /**
     * 更新订单
     * @param request
     * @return
     */
    @PostMapping("/order/update")
    Result update(@RequestHeader("token") String token, OrderInfoRequest request);

}